package com.example.ioc.controller;

import com.example.spring.framework.annotation.Controller;
import com.example.spring.framework.annotation.RequestMapping;
import com.example.spring.framework.annotation.RequestParam;
import com.example.spring.framework.annotation.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ：wuhong-016
 * @version v1.0.0
 * @Create : 2021/1/18 15:51
 * @Description : TODO
 **/
@Controller
@RequestMapping("/security")
public class SecurityController {

    /**
     *
     * @param request
     * @param response
     * @param fromCardNo
     * @param toCardNo
     * @param money
     */
    @Security("chsrish")
    @RequestMapping("/test")
    public void test(HttpServletRequest request, HttpServletResponse response, @RequestParam("fromCardNo") String fromCardNo, @RequestParam("toCardNo") String toCardNo, @RequestParam("money") String money) {
        // 响应
        this.out(response, "success");
    }

    private void out(HttpServletResponse response, String str) {
        try {
            response.getWriter().write(str);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
